pred_flounder_sad <- list ()
pred_flounder_ben <- list ()
pred_cod_sad <- list ()
pred_cod_ben <- list ()
coef_sad <- list ()
coef_ben <- list ()
res_sad <- list ()
res_ben <- list ()
random_sad <- list ()
random_ben <- list ()
range_sad <- list ()
range_ben <- list ()
for (i in unique (d$ group)) {
dd <- filter (d, group == i)
if (i == "flounder" ){
weigths <- dd$ f_weight
} else if (i == "small cod" ){
weigths <- dd$ sc_weight
} else if (i == "large cod" ){
weigths <- dd$ lc_weight
}
mesh <- make_mesh (dd,
xy_cols = c ("X" , "Y" ),
cutoff = 5 )
ggplot () +
inlabru:: gg (mesh$ mesh) +
coord_fixed () +
geom_point (aes (X, Y), data = dd, alpha = 0.2 , size = 0.5 ) +
labs (x = "Easting (km)" , y = "Northing (km)" )
ggsave (paste0 (home, "/figures/supp/mesh_" , i, ".pdf" ), width = 17 , height = 17 , units = "cm" )
# Saduria model
m_sad <- sdmTMB (saduria_rel_weight ~ 0 + fyear + fquarter + depth_sc + oxygen_sc + pred_length_cm_sc +
small_cod_density_sc* density_saduria_sc +
flounder_density_sc* density_saduria_sc,
data = dd,
mesh = mesh,
family = tweedie (),
weights = weigths,
spatiotemporal = "iid" ,
spatial = "on" ,
time = "year" )
print (i)
sanity (m_sad)
print (m_sad)
# Benthic model
if (unique (dd$ group) %in% c ("large cod" , "small cod" )) {
m_ben <- sdmTMB (benthic_rel_weight ~ 0 + fyear + fquarter + depth_sc + pred_length_cm_sc +
small_cod_density_sc* oxygen_sc + flounder_density_sc* oxygen_sc,
data = dd,
mesh = mesh,
family = tweedie (),
weights = weigths,
spatiotemporal = "iid" ,
spatial = "off" ,
time = "year" )
print (i)
sanity (m_ben)
print (m_ben)
} else {
m_ben <- sdmTMB (benthic_rel_weight ~ 0 + fyear + fquarter + depth_sc + pred_length_cm_sc +
small_cod_density_sc* oxygen_sc + flounder_density_sc* oxygen_sc,
data = dd,
mesh = mesh,
family = tweedie (),
weights = weigths,
spatiotemporal = "iid" ,
spatial = "on" ,
time = "year" )
print (i)
sanity (m_ben)
print (m_ben)
}
# Spatial and spatiotemporal random effects
d_haul <- dd |>
distinct (haul_id, .keep_all = TRUE )
preds_sad <- predict (m_sad, newdata = d_haul)
preds_ben <- predict (m_ben, newdata = d_haul)
random_sad[[i]] <- preds_sad
random_ben[[i]] <- preds_ben
# Residuals
samps <- sdmTMBextra:: predict_mle_mcmc (m_sad, mcmc_iter = 401 , mcmc_warmup = 400 )
mcmc_res <- residuals (m_sad, type = "mle-mcmc" , mcmc_samples = samps)
dd$ res <- as.vector (mcmc_res)
res_sad[[i]] <- dd
samps <- sdmTMBextra:: predict_mle_mcmc (m_ben, mcmc_iter = 401 , mcmc_warmup = 400 )
mcmc_res <- residuals (m_ben, type = "mle-mcmc" , mcmc_samples = samps)
dd$ res <- as.vector (mcmc_res)
res_ben[[i]] <- dd
# Ranges
range_sad[[i]] <- tidy (m_sad, effects = "ran_pars" ) |> filter (term == "range" ) |> mutate (group = i, model = "saduria" )
range_ben[[i]] <- tidy (m_ben, effects = "ran_pars" ) |> filter (term == "range" ) |> mutate (group = i, model = "benthos" )
# Conditional effects: flounder
nd_flounder <- data.frame (expand_grid (
density_saduria_sc = c (quantile (d$ density_saduria_sc, probs = 0.05 ),
mean (d$ density_saduria_sc),
quantile (d$ density_saduria_sc, probs = 0.95 )),
flounder_density_sc = seq (quantile (dd$ flounder_density_sc, probs = 0.05 ),
quantile (dd$ flounder_density_sc, probs = 0.95 ),
length.out = 50 ))) |>
mutate (year = 2020 ,
fyear = as.factor (2020 ),
fquarter = as.factor (1 ),
pred_length_cm_sc = 0 ,
oxygen_sc = 0 ,
depth_sc = 0 ,
small_cod_density_sc = 0 )
preds_flounder_sad <- predict (m_sad, newdata = nd_flounder, re_form = NA , re_form_iid = NA , se_fit = TRUE )
preds_flounder_ben <- predict (m_ben, newdata = nd_flounder, re_form = NA , re_form_iid = NA , se_fit = TRUE )
pred_flounder_sad[[i]] <- preds_flounder_sad |> mutate (group = i, xvar = "flounder" )
pred_flounder_ben[[i]] <- preds_flounder_ben |> mutate (group = i, xvar = "flounder" )
# Conditional effects: cod
nd_cod <- data.frame (expand_grid (
density_saduria_sc = c (quantile (d$ density_saduria_sc, probs = 0.05 ),
quantile (d$ density_saduria_sc, probs = 0.95 )),
small_cod_density_sc = seq (quantile (dd$ small_cod_density_sc, probs = 0.05 ),
quantile (dd$ small_cod_density_sc, probs = 0.95 ),
length.out = 50 ))) |>
mutate (year = 2020 ,
fyear = as.factor (2020 ),
fquarter = as.factor (1 ),
pred_length_cm_sc = 0 ,
oxygen_sc = 0 ,
depth_sc = 0 ,
flounder_density_sc = 0 ) #
preds_cod_sad <- predict (m_sad, newdata = nd_cod, re_form = NA , re_form_iid = NA , se_fit = TRUE )
preds_cod_ben <- predict (m_ben, newdata = nd_cod, re_form = NA , re_form_iid = NA , se_fit = TRUE )
pred_cod_sad[[i]] <- preds_cod_sad |> mutate (group = i, xvar = "cod" )
pred_cod_ben[[i]] <- preds_cod_ben |> mutate (group = i, xvar = "cod" )
# Coefficients
coefs_sad <- bind_rows (tidy (m_sad, effects = "fixed" , conf.int = TRUE )) |>
mutate (species = "Cod (m)" ,
response = "Saduria" ,
sig = ifelse (estimate > 0 & conf.low > 0 , "Y" , "N" ),
sig = ifelse (estimate < 0 & conf.high < 0 , "Y" , sig))
coefs_ben <- bind_rows (tidy (m_ben, effects = "fixed" , conf.int = TRUE )) |>
mutate (species = "Cod (m)" ,
response = "Saduria" ,
sig = ifelse (estimate > 0 & conf.low > 0 , "Y" , "N" ),
sig = ifelse (estimate < 0 & conf.high < 0 , "Y" , sig))
coef_sad[[i]] <- coefs_sad |> mutate (group = i)
coef_ben[[i]] <- coefs_ben |> mutate (group = i)
}
filter: removed 5,629 rows (60%), 3,737 rows remaining
Loading required namespace: INLA
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: saduria_rel_weight ~ 0 + fyear + fquarter + depth_sc + oxygen_sc +
Formula: pred_length_cm_sc + small_cod_density_sc * density_saduria_sc +
Formula: flounder_density_sc * density_saduria_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -8.23 0.91
fyear2016 -10.13 0.70
fyear2017 -10.02 0.72
fyear2018 -8.72 0.80
fyear2019 -11.29 1.13
fyear2020 -9.85 0.69
fyear2021 -10.09 0.74
fyear2022 -10.38 0.77
fquarter4 -0.37 0.38
depth_sc -0.64 0.35
oxygen_sc 0.34 0.28
pred_length_cm_sc -0.69 0.09
small_cod_density_sc 0.21 0.27
density_saduria_sc 0.59 0.32
flounder_density_sc -0.57 0.27
small_cod_density_sc:density_saduria_sc 0.07 0.26
density_saduria_sc:flounder_density_sc 0.23 0.24
Dispersion parameter: 0.08
Tweedie p: 1.43
Matérn range: 17.53
Spatial SD: 2.27
Spatiotemporal IID SD: 1.77
ML criterion at convergence: -671.212
See ?tidy.sdmTMB to extract these values as a data frame.
[1] "large cod"
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: benthic_rel_weight ~ 0 + fyear + fquarter + depth_sc + pred_length_cm_sc +
Formula: small_cod_density_sc * oxygen_sc + flounder_density_sc *
Formula: oxygen_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -6.23 0.38
fyear2016 -7.09 0.25
fyear2017 -6.47 0.27
fyear2018 -6.57 0.30
fyear2019 -7.52 0.41
fyear2020 -6.51 0.27
fyear2021 -6.48 0.26
fyear2022 -6.44 0.28
fquarter4 0.76 0.13
depth_sc -0.04 0.09
pred_length_cm_sc -0.25 0.03
small_cod_density_sc -0.17 0.10
oxygen_sc 0.49 0.10
flounder_density_sc -0.04 0.10
small_cod_density_sc:oxygen_sc 0.02 0.06
oxygen_sc:flounder_density_sc -0.01 0.08
Dispersion parameter: 0.26
Tweedie p: 1.63
Matérn range: 10.08
Spatiotemporal IID SD: 1.47
ML criterion at convergence: -7083.399
See ?tidy.sdmTMB to extract these values as a data frame.
distinct: removed 3,426 rows (92%), 311 rows remaining
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.005737 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 57.37 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 74.047 seconds (Warm-up)
Chain 1: 0.215 seconds (Sampling)
Chain 1: 74.262 seconds (Total)
Chain 1:
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.005569 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 55.69 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 36.407 seconds (Warm-up)
Chain 1: 0.049 seconds (Sampling)
Chain 1: 36.456 seconds (Total)
Chain 1:
filter: removed 4 rows (80%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
filter: removed 3 rows (75%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'small_cod_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'flounder_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
filter: removed 7,619 rows (81%), 1,747 rows remaining
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: saduria_rel_weight ~ 0 + fyear + fquarter + depth_sc + oxygen_sc +
Formula: pred_length_cm_sc + small_cod_density_sc * density_saduria_sc +
Formula: flounder_density_sc * density_saduria_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -9.15 1.39
fyear2016 -10.46 1.17
fyear2017 -10.59 1.10
fyear2018 -10.74 1.51
fyear2019 -9.37 1.48
fyear2020 -10.09 1.12
fyear2021 -11.39 1.03
fyear2022 -11.03 1.14
fquarter4 -1.59 0.36
depth_sc -0.95 0.51
oxygen_sc -0.32 0.34
pred_length_cm_sc 1.13 0.08
small_cod_density_sc 0.17 0.35
density_saduria_sc 0.99 0.45
flounder_density_sc -1.20 0.34
small_cod_density_sc:density_saduria_sc -0.57 0.34
density_saduria_sc:flounder_density_sc 0.61 0.34
Dispersion parameter: 0.12
Tweedie p: 1.49
Matérn range: 23.61
Spatial SD: 3.41
Spatiotemporal IID SD: 2.63
ML criterion at convergence: -1701.241
See ?tidy.sdmTMB to extract these values as a data frame.
[1] "small cod"
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: benthic_rel_weight ~ 0 + fyear + fquarter + depth_sc + pred_length_cm_sc +
Formula: small_cod_density_sc * oxygen_sc + flounder_density_sc *
Formula: oxygen_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -6.02 0.35
fyear2016 -5.74 0.22
fyear2017 -5.48 0.21
fyear2018 -5.47 0.27
fyear2019 -5.96 0.35
fyear2020 -5.66 0.22
fyear2021 -5.99 0.19
fyear2022 -5.80 0.21
fquarter4 0.32 0.10
depth_sc -0.42 0.09
pred_length_cm_sc -0.23 0.02
small_cod_density_sc 0.00 0.09
oxygen_sc 0.11 0.08
flounder_density_sc -0.02 0.07
small_cod_density_sc:oxygen_sc -0.07 0.09
oxygen_sc:flounder_density_sc 0.06 0.08
Dispersion parameter: 0.07
Tweedie p: 1.52
Matérn range: 10.14
Spatiotemporal IID SD: 1.30
ML criterion at convergence: -11124.987
See ?tidy.sdmTMB to extract these values as a data frame.
distinct: removed 1,472 rows (84%), 275 rows remaining
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.005812 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 58.12 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 172.234 seconds (Warm-up)
Chain 1: 0.451 seconds (Sampling)
Chain 1: 172.685 seconds (Total)
Chain 1:
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.005337 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 53.37 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 46.469 seconds (Warm-up)
Chain 1: 0.05 seconds (Sampling)
Chain 1: 46.519 seconds (Total)
Chain 1:
filter: removed 4 rows (80%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
filter: removed 3 rows (75%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'small_cod_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'flounder_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
filter: removed 5,484 rows (59%), 3,882 rows remaining
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: saduria_rel_weight ~ 0 + fyear + fquarter + depth_sc + oxygen_sc +
Formula: pred_length_cm_sc + small_cod_density_sc * density_saduria_sc +
Formula: flounder_density_sc * density_saduria_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -7.31 1.01
fyear2016 -5.41 0.89
fyear2017 -8.11 0.85
fyear2018 -8.58 0.96
fyear2019 -6.83 1.01
fyear2020 -7.62 0.86
fyear2021 -9.63 1.15
fyear2022 -8.45 0.90
fquarter4 -1.39 0.30
depth_sc -0.46 0.27
oxygen_sc 0.14 0.22
pred_length_cm_sc 0.15 0.06
small_cod_density_sc 0.55 0.16
density_saduria_sc 0.16 0.20
flounder_density_sc -0.98 0.19
small_cod_density_sc:density_saduria_sc 0.13 0.14
density_saduria_sc:flounder_density_sc -0.21 0.19
Dispersion parameter: 0.22
Tweedie p: 1.52
Matérn range: 66.75
Spatial SD: 2.07
Spatiotemporal IID SD: 1.43
ML criterion at convergence: -1086.911
See ?tidy.sdmTMB to extract these values as a data frame.
[1] "flounder"
✔ Non-linear minimizer suggests successful convergence
✔ Hessian matrix is positive definite
✔ No extreme or very small eigenvalues detected
✔ No gradients with respect to fixed effects are >= 0.001
✔ No fixed-effect standard errors are NA
✔ No standard errors look unreasonably large
✔ No sigma parameters are < 0.01
✔ No sigma parameters are > 100
✔ Range parameter doesn't look unreasonably large
Spatiotemporal model fit by ML ['sdmTMB']
Formula: benthic_rel_weight ~ 0 + fyear + fquarter + depth_sc + pred_length_cm_sc +
Formula: small_cod_density_sc * oxygen_sc + flounder_density_sc *
Formula: oxygen_sc
Mesh: mesh (isotropic covariance)
Time column: year
Data: dd
Family: tweedie(link = 'log')
Conditional model:
coef.est coef.se
fyear2015 -4.73 0.28
fyear2016 -5.01 0.25
fyear2017 -4.89 0.19
fyear2018 -5.35 0.23
fyear2019 -4.89 0.26
fyear2020 -4.48 0.17
fyear2021 -5.33 0.23
fyear2022 -5.06 0.19
fquarter4 0.05 0.12
depth_sc -0.48 0.11
pred_length_cm_sc -0.03 0.02
small_cod_density_sc 0.26 0.07
oxygen_sc -0.07 0.08
flounder_density_sc -0.28 0.08
small_cod_density_sc:oxygen_sc -0.07 0.05
oxygen_sc:flounder_density_sc 0.07 0.07
Dispersion parameter: 0.14
Tweedie p: 1.49
Matérn range: 15.20
Spatial SD: 0.78
Spatiotemporal IID SD: 0.62
ML criterion at convergence: -4221.382
See ?tidy.sdmTMB to extract these values as a data frame.
distinct: removed 3,616 rows (93%), 266 rows remaining
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.006037 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 60.37 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 282.131 seconds (Warm-up)
Chain 1: 0.954 seconds (Sampling)
Chain 1: 283.085 seconds (Total)
Chain 1:
SAMPLING FOR MODEL 'tmb_generic' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.006351 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 63.51 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 401 [ 0%] (Warmup)
Chain 1: Iteration: 40 / 401 [ 9%] (Warmup)
Chain 1: Iteration: 80 / 401 [ 19%] (Warmup)
Chain 1: Iteration: 120 / 401 [ 29%] (Warmup)
Chain 1: Iteration: 160 / 401 [ 39%] (Warmup)
Chain 1: Iteration: 200 / 401 [ 49%] (Warmup)
Chain 1: Iteration: 240 / 401 [ 59%] (Warmup)
Chain 1: Iteration: 280 / 401 [ 69%] (Warmup)
Chain 1: Iteration: 320 / 401 [ 79%] (Warmup)
Chain 1: Iteration: 360 / 401 [ 89%] (Warmup)
Chain 1: Iteration: 400 / 401 [ 99%] (Warmup)
Chain 1: Iteration: 401 / 401 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 47.119 seconds (Warm-up)
Chain 1: 0.24 seconds (Sampling)
Chain 1: 47.359 seconds (Total)
Chain 1:
filter: removed 4 rows (80%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
filter: removed 4 rows (80%), one row remaining
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'model' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'small_cod_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'year' (double) with one unique value and 0% NA
new variable 'fyear' (factor) with one unique value and 0% NA
new variable 'fquarter' (factor) with one unique value and 0% NA
new variable 'pred_length_cm_sc' (double) with one unique value and 0% NA
new variable 'oxygen_sc' (double) with one unique value and 0% NA
new variable 'depth_sc' (double) with one unique value and 0% NA
new variable 'flounder_density_sc' (double) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
new variable 'xvar' (character) with one unique value and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'species' (character) with one unique value and 0% NA
new variable 'response' (character) with one unique value and 0% NA
new variable 'sig' (character) with 2 unique values and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA
mutate: new variable 'group' (character) with one unique value and 0% NA